<route lang="jsonc" type="page">
    {
      "layout": "default",
      "style": {
        "navigationStyle": "custom",
        "backgroundColor": "#ffffff"
      }
    }
</route>

<script lang="ts" setup>
import { useRouter } from 'vue-router';

// 路由实例
const router = useRouter();

// 查看订单按钮点击事件
const viewOrder = () => {
  // 这里可以添加查看订单的逻辑
  console.log('查看订单');
  // 示例：跳转到订单详情页
  router.push('/pages/allorder/allorder');
};

// 返回诊室按钮点击事件
const returnToConsultation = () => {
  // 这里可以添加返回诊室的逻辑
  console.log('返回诊室');
  // 示例：返回上一页
  router.push('/pages/inquiry/inquiry');

};
</script>

<template>
  <view class="success-container">
    <!-- 成功图标 -->
    <view class="success-icon-container">
      <view class="success-icon">
        <text class="check-mark">✓</text>
      </view>
    </view>

    <!-- 支付金额 -->
    <view class="amount-text">¥39.00</view>

    <!-- 支付成功文字 -->
    <view class="success-text">支付成功</view>

    <!-- 提示信息 -->
    <view class="hint-text">订单支付成功，已通知药房尽快发出，请耐心等待~</view>

    <!-- 按钮区域 -->
    <view class="button-container">
      <button class="view-order-btn" @click="viewOrder">查看订单</button>
      <button class="return-btn" @click="returnToConsultation">返回诊室</button>
    </view>
  </view>
</template>

<style lang="scss" scoped>
.success-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 100rpx 0;
  height: 100vh;
  box-sizing: border-box;
  background-color: #ffffff;
}

.success-icon-container {
  margin-top: 120rpx;
  margin-bottom: 60rpx;
}

.success-icon {
  width: 180rpx;
  height: 180rpx;
  background-color: #11c1a2;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.check-mark {
  color: #ffffff;
  font-size: 80rpx;
  font-weight: bold;
}

.amount-text {
  font-size: 60rpx;
  font-weight: bold;
  color: #333333;
  margin-bottom: 20rpx;
}

.success-text {
  font-size: 36rpx;
  color: #333333;
  margin-bottom: 40rpx;
}

.hint-text {
  font-size: 28rpx;
  color: #999999;
  text-align: center;
  line-height: 1.5;
  padding: 0 60rpx;
  margin-bottom: 120rpx;
}

.button-container {
  display: flex;
  flex-direction: column;
  width: 80%;
  gap: 30rpx;
}

.view-order-btn {
  width: 100%;
  height: 90rpx;
  background-color: #11c1a2;
  color: #ffffff;
  font-size: 32rpx;
  border-radius: 45rpx;
  border: none;
}

.return-btn {
  width: 100%;
  height: 90rpx;
  background-color: #ffffff;
  color: #11c1a2;
  font-size: 32rpx;
  border-radius: 45rpx;
  border: 1rpx solid #11c1a2;
}
</style>